package com.example.todolist.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.example.todolist.common.AbstractDO;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author admin
 * @since 2022-02-25
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="Dynamic对象", description="")
public class Dynamic extends AbstractDO {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "动态id")
    private String dynamicId;

    @ApiModelProperty(value = "动态内容")
    private String dynamicContent;

    @ApiModelProperty(value = "发布者用户id")
    private String uid;

    @ApiModelProperty(value = "图片内容")
    private String pictureUrl;

    @ApiModelProperty(value = "发布者头像")
    private String avatarUrl;

    @ApiModelProperty(value = "发布者昵称")
    private String nickname;

    @ApiModelProperty(value = "评论总数")
    private Integer commentTotal;

    /**
     * 数据库不存在的,将图片URL整理为一个List
     */
    @TableField(exist = false)
    private List listImage;

    /**
     * 动态发布时间(距离现在)
     */
    @TableField(exist = false)
    private String passPublishTime;

    @TableField(exist = false)
    private List<DynamicComments> dynamicCommentsList= new ArrayList<>();


}
